
cap mkdir `"$output/counterfactuals"'

//use the data that were created in the summary stats do file
use `"$output/summary_stats/variation/bined_variation.dta"', clear 

keep if pay_type==2
egen procID = group(proc1)
save "$output/counterfactuals/all_Medicaid_procedures.dta" , replace
keep if rec_rate!=.
export delimited using "$output/counterfactuals/simulation_input.csv", replace
